package abcy.cloud.authenticationserver.controller;

import abcy.cloud.authenticationserver.dto.req.SysClientAddReq;
import abcy.cloud.authenticationserver.services.OauthClientDetailsService;
import abcy.cloud.blogcommon.resp.ResponseEntity;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping(value = "/client")
public class OauthClientController {

    @Autowired
    private OauthClientDetailsService sysClientService;


    @ApiOperation(value = "新增client")
    @PostMapping("addClient")
    public ResponseEntity addClient(@RequestBody SysClientAddReq sysClientAddReq, HttpServletRequest httpServletRequest) {
        sysClientService.addSysClient(sysClientAddReq);
        return ResponseEntity.success();
    }
}
